//获取书籍信息
import axios from "axios";
import { ElMessage } from "element-plus";
import { ref } from "vue";
import { getCurrentInstance } from "vue";

export async function getAvatar(proxy) {
  console.log(proxy);
  try {
    const response = await proxy.$http.post("/get_head/",  {});
    const res = response.data;
    console.log(res);
    const isSuccess = response.success;
    const message = response.message;
    if (isSuccess === false) {
      ElMessage.error(message);
    } else {
      // ElMessage.success("获取头像成功");
      return res.head;
    }
  } catch (error) {
    console.error(`Error fetching books:`, error);
    return [];
  }
}
